﻿package util
{
	import flash.display.DisplayObject;
	import flash.events.Event;
	import flash.events.EventDispatcher;
	
	/**
	 * ...
	 * @author ...
	 */
	public class  Evt extends EventDispatcher	
	{
		
		
		public static function add(tg:Object, e:Object, hdl:Function):void{
		
				
			if (e == "mouse") {
				e = ["mouseOver", "mouseOut", "click"];
			}
	
			
			for (var i:uint = 0; i < tg.length;++i) {
				for (var j:uint = 0; j < e.length;++j){
					tg[i].addEventListener(e[j], hdl);
				}
			}
		}
		
		
		public static function remove(tg:Object, e:Object, hdl:Function):void{
		
				
			if (e == "mouse") {
				e = ["mouseOver", "mouseOut", "click"];
			}
	
			
			for (var i:uint = 0; i < tg.length;++i) {
				for (var j:uint = 0; j < e.length;++j){
					tg[i].removeEventListener(e[j], hdl);
				}
			}
		}
		
		
		
	}
	
}